package fr.auzaiphe.titleScreen;

import java.util.Properties;

import javax.swing.JFrame;
import javax.swing.UIManager;

import com.jtattoo.plaf.smart.SmartLookAndFeel;

/**
 * Fenetre de l'�cran titre
 * @author Jojo
 */
public class AccueilFrame
{
	private TitleScreen titleScreen;
	private JFrame fenetre;
	/**
	 * Constructeur
	 */
	public AccueilFrame( TitleScreen pTitleScreen )
	{
		try 
        {
                Properties props = new Properties();
		        
		        props.put("logoString", "Murder Party"); 
		        props.put("licenseKey", "GPL");
		        
		        props.put("selectionBackgroundColor", "200 210 220"); 
		        props.put("menuSelectionBackgroundColor", "200 210 220"); 
		        
		        props.put("controlColor", "218 254 230");
		        props.put("controlColorLight", "220 230 240");
		        props.put("controlColorDark", "200 210 220"); 
		
		        props.put("buttonColor", "255 255 255");
		        props.put("buttonColorLight", "255 255 255");
		        props.put("buttonColorDark", "200 200 200");
		
		        props.put("rolloverColor", "255 255 255"); 
		        props.put("rolloverColorLight", "240 250 255"); 
		        props.put("rolloverColorDark", "220 230 240"); 
		
		        props.put("windowTitleForegroundColor", "255 255 255");
		        props.put("windowTitleBackgroundColor", "180 240 197"); 
		        props.put("windowTitleColorLight", "0 0 0"); 
		        props.put("windowTitleColorDark", " 100 100 100"); 
		        props.put("windowBorderColor", "0 0 0");
		        // set your theme
		        SmartLookAndFeel.setCurrentTheme(props);
                UIManager.setLookAndFeel("com.jtattoo.plaf.smart.SmartLookAndFeel");
        } 
        catch (Exception e) 
        {
          e.printStackTrace();
        }
		
		this.titleScreen = pTitleScreen;

		/* Mise en place de la fenetre */
		this.fenetre = new JFrame("Murder Party");
		this.fenetre.setSize(800, 600);
		this.fenetre.setLocationRelativeTo( null );
		this.fenetre.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

		/* Ajout du panel */
		AccueilPanel panel = new AccueilPanel( this.titleScreen );
		this.fenetre.add( panel );

		this.fenetre.setVisible( true );
	}

	/**
	 * Fermeture de la fenetre
	 */
	public void close()
	{
		this.fenetre.dispose();
	}
}
